<template>
<div class="main-content">
  <img :src="article.pictureUrl" style="width:100%">
<h1>
  {{article.title}}
</h1>
  <h2>
    {{article.overView}}
  </h2>
      <mavon-editor
          class="md"
          :value="article.content"
          :subfield="false"
          :defaultOpen="'preview'"
          :toolbarsFlag="false"
          :editable="false"
          :scrollStyle="true"
          :ishljs="true"
      />

</div>
</template>

<script>
import axios from "@/request";

export default {
  name: "SingleArticle",
  data(){
    return {
      title:"",
      article:{}
    }
  },
  methods:{
    getArticle(){
      axios.post('article/getArticleByTitle', {
        title:this.title
      }).then((res) => {
        console.log(res)
        this.article = res.data;

      })
    }
  },
 mounted() {
   this.title = this.$route.params.title
   this.getArticle()

 }
}
</script>

<style scoped>

</style>
